baseUrl="https://music.aityp.com/"
function http({url,data}){
    return new Promise((resolve,reject)=>{
        wx.request({
            url:baseUrl+url,
            data,
            header: {'content-type':'application/json'},
            method: 'GET',
            dataType: 'json',
            responseType: 'text',
            success: (result) => {
                resolve(result)
            },
            fail: (err) => {
                reject(err)
            },            
        });
          
    })
}
module.exports={
    getHot:()=>{
       return http({
            url:"top/playlist",
            data:{
                order:"hot"
            },
           
        })
    },
    getJapan:()=>{
       return http({
            url:"top/playlist",
            data:{
                cat:"日语"
            },
           
        })
    },
    getRadio(){
        return http({
            url:"personalized/djprogram"
        })
    },
    getSongs({id}){
        return http({
            url:"playlist/detail",
            data:{
                id,
            }
        })
    },
    getMusic({id}){
        return http({
            url:"song/url",
            data:{
                id,
            }
        })
    }
}